
$(function(){
    Mcategory(1);

});


function Mcategory(category,a){

    var op="";
    $.ajax({
        type: 'get',
        url: '/index.php?c=beautyExclusive&a=Mcategory',
        data: 'category=' +category,
        success: function (data) {
            var json_list =  eval('(' + data + ')');
            $("#category2").empty();
            if(json_list.list.length)
            {
                //alert(json_list.list[0]['id']);
                for(i=0;i<json_list.list.length;i++)
                {

                    op+="<option   value='"+json_list.list[i]['cateid']+"'>"+json_list.list[i]['cateName']+"</option>";
                }
                $("#category2").append(op);
            }
        }
    });
}
function validateAddbeautyExlusiveForm()
{
    var name = $("#name").val();
    if(name.length == 0)
    {
        alert("请输入服务名称");
        return false;
    }

    var price = $("#price").val();
    if(price.length == 0)
    {
        alert("请输入服务价格");
        return false;
    }

    var consume = $("#consume").val();
    if(consume.length == 0 ||consume==0)
    {
        alert("请输入服务所需时间");
        return false;
    }
    var keep = $("#keep").val();
    if(keep.length == 0|| keep==0)
    {
        alert("请输入服务维持时间");
        return false;
    }
}
